﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet
{
    class ListEventArgs<T> : EventArgs
    {
        private readonly List<T> _items;

        public ListEventArgs(List<T> items)
        {
            Contract.Requires(items != null);
            Contract.Requires(items.Count > 0);
            _items = items;
        }

        public IEnumerable<T> GetItems()
        {
            return Items;
        }
        public List<T> Items
        {
            get { return _items; }
        }
    }
    class CellListEventArgs: ListEventArgs<Cell>
    {
        public CellListEventArgs(List<Cell> items) : base(items)
        {
            Contract.Requires(Enumerable.All(items, c => c != null));
        }
    }
}